Conversation
doc improvements better docs rename exists to isSomeAnd like Rust changelog
|
How about this @zth @aspeddro @DZakh and anyone else? This is a small part of #85 and based on analogous functions in Rust and the Array module. As long as we have an Option module I think we should make it more complete and convenient. I am happy to get feedback from the community on a larger set of improvements. |
|
I agree that since we have There are a few reasons why I don't like the proposed functions:
So instead, I'd suggest adding |
|
Thanks for the thoughtful analysis. As for naming, some alternate names would be Without Alternately you could accomplish both with Piping? Don’t understand that argument. If I’m also a big fan of falling into the pit of success. I don’t think that means minimalist and only one way to do something. It means finding a good balance. Technically we don’t need One last thing. There is an |
This adds two functions -
Option.isSomeAndandOption.isNoneOr. Full and really good documentation and tests. These are convenience functions that lead to shorter and easier-to-understand code. These correspond to the quantifiers "forAll" and "exists" in mathematics. We have analogous functions on the Array module.isSomeAndis likeArray.some. Another common name isexists. But I like the parallel usage here.isNoneOris likeArray.every. Another common name isforAll. But I and other people find this naming a little confusing for empty collections. For every PR I've received money for, I got $1 million dollars. Technically true.Rust discussion on isSomeAnd: rust-lang/rust#93050
F#: https://fsharp.github.io/fsharp-core-docs/reference/fsharp-core-optionmodule.html